import request from '@/utils/request'

/**
 * 登录
 *
 * @param {any} query
 * @returns 登录
 */
export const login = async (query: any) => {
    return await request({
        url: "/system/login",
        method: "post",
        params: query,
    });
};

/**
 * 登录
 *
 * @param {any} query
 * @returns 登录
 */
export const loginCaptcha = async (query: any) => {
    return await request({
        url: "/system/captcha",
        method: "get",
        params: query,
    });
};

/**
 * 退出登录
 *
 * @param {any} query
 * @returns 退出登录
 */
export const logout = async (query: any) => {
    return await request({
        url: "/system/logout",
        method: "post",
        params: query,
    });
};

/**
 * 用户信息
 *
 * @param {any} query
 * @returns 用户信息
 */
export const getUserInfo = async (query: any) => {
    return await request({
        url: "/system/admin/self",
        method: "get",
        params: query,
    });
};

/**
 * 菜单路由
 *
 * @param {any} query
 * @returns 菜单路由
 */
export const getMenu = async (query: any) => {
    return await request({
        url: "/system/menu/route",
        method: "get",
        params: query,
    });
};

/**
 * 编辑管理员信息
 *
 * @param {any} query
 * @returns 编辑管理员信息
 */
export const setUserInfo = async (query: any) => {
    return await request({
        url: "/system/admin/upInfo",
        method: "post",
        params: query,
    });
};

/**
 * 重置谷歌验证码
 *
 * @param {any} query
 * @returns 重置谷歌验证码
 */
export const googleReset = async (query: any) => {
    return await request({
        url: "/system/admin/resetGoogleCode",
        method: "post",
        params: query,
    });
};

/**
 * 获取谷歌验证码二维码
 *
 * @param {any} query
 * @returns 获取谷歌验证码二维码
 */
export const googleQrCode = async (query: any) => {
    return await request({
        url: "/system/admin/createGoogleQrCode",
        method: "post",
        params: query,
    });
};

/**
 * 开启/关闭谷歌验证码
 *
 * @param {any} query
 * @returns 开启/关闭谷歌验证码
 */
export const googleEdit = async (query: any) => {
    return await request({
        url: "/system/admin/editGoogle",
        method: "post",
        params: query,
    });
};

/**
 * 开启/关闭二级谷歌验证码
 *
 * @param {any} query
 * @returns 开启/关闭二级谷歌验证码
 */
export const editIsSecondGoogle = async (query: any) => {
    return await request({
        url: "/system/admin/editIsSecondGoogle",
        method: "post",
        params: query,
    });
};

/**
 * 取消代理
 *
 * @param {any} query
 * @returns 取消代理
 */
export const cancelAgent = async (query: any) => {
    return await request({
        url: "/user/cancelAgent",
        method: "post",
        params: query,
    });
};

/**
 * 更新余额
 *
 * @param {any} query
 * @returns 更新余额
 */
export const changeMoney = async (query: any) => {
    return await request({
        url: "/user/changeMoney",
        method: "post",
        params: query,
    });
};

/**
 * 设置真人家人
 *
 * @param {any} query
 * @returns 设置真人家人
 */
export const dummyStatus = async (query: any) => {
    return await request({
        url: "/user/dummy",
        method: "post",
        params: query,
    });
};

/**
 * 用户批量加扣款
 *
 * @param {any} query
 * @returns 用户批量加扣款
 */
export const batchAndDeduction = async (query: any) => {
    return await request({
        url: "/user/batchFund",
        method: "post",
        params: query,
    });
};

/**
 * 批量冻结账号
 *
 * @param {any} query
 * @returns 批量冻结账号
 */
export const batchFreezeUserMoney = async (query: any) => {
    return await request({
        url: "/user/batchFreezeUserMoney",
        method: "post",
        params: query,
    });
};

/**
 * 冻仓
 *
 * @param {any} query
 * @returns 冻仓
 */
export const batchLimitMoney = async (query: any) => {
    return await request({
        url: "/user/batchLimitMoney",
        method: "post",
        params: query,
    });
};

